package com.mryx.demo.service.serviceImpl;

import com.mryx.demo.mapper.SupplierMapper;
import com.mryx.demo.pojo.Supplier;
import com.mryx.demo.service.SupplierService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 供应商业务实现层
 * */
@Service
public class SupplierServiceImpl implements SupplierService {

    @Autowired
    SupplierMapper supplierMapper;

    /**
     * 获取供应商信息
     * @return
     */
    @Override
    public List<Supplier> getAllSupplier() {
        return supplierMapper.getAllSupplier();
    }

    /**
     * 根据供应商编号修改状态
     * @param sid
     * @return
     */
    @Override
    public int examine(int sid,int examine) {
        return supplierMapper.examine(sid,examine);
    }

    //根据手机号修改密码
    @Override
    public int updPasswd(String phone, String password) {
        return supplierMapper.updPasswd(phone,password);
    }

    //信息录入
    @Override
    public int InfoInput(Supplier supplier) {
        return supplierMapper.InfoInput(supplier);
    }

    //注册
    @Override
    public int register(String login, String password,String phone) {
        return supplierMapper.register(login,password,phone);
    }

    @Override
    public Supplier login(String login, String password) {
        return supplierMapper.login(login,password);
    }


}
